import { Controller, Post, Body, Get, Query, Param } from '@nestjs/common';
import { CenterService } from './center.service';
// import { CreateCenterDto } from './dto/create-center.dto';
// import { UpdateCenterDto } from './dto/update-center.dto';

@Controller('center')
export class CenterController {
  constructor(private readonly centerService: CenterService) {}

  // @Post('/series')
  // createCenterSeries(@Body() body) {
  //   return this.centerService.createCenterSeries(
  //     body.manufacturers,
  //     body.series,
  //   );
  // }

  @Post('/info')
  createCenterInfo(@Body() body: any) {
    return this.centerService.createCenterInfo(body);
  }

  @Get('/info')
  getCenterInfo(@Query() query) {
    return this.centerService.getCenterInfo(query);
  }

  @Get('/info/:id')
  getCenterInfoById(@Param('id') id: string) {


    return this.centerService.getCenterInfoById(id);
  }

  //修改Center信息
  @Post('/info/:id')
  updateCenterInfo(@Param('id') id: string, @Body() body: any) {
    return this.centerService.updateCenterInfo(id, body);
  }

  //删除Center信息
  @Post('/info/delete/:id')
  deleteCenterInfo(@Param('id') id: string) {
    return this.centerService.deleteCenterInfo(id);
  }

  //请求所有Center信息
  @Get('/total')
  getTotal() {
    return this.centerService.getAllCenterInfo();
  }
}
